package org.e_gold.controller;

import org.e_gold.factory.AppProperties;
import org.e_gold.factory.Manager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/home/secret")
public class MainController {

    @Autowired
    private Manager manager;

    @Autowired
    private AppProperties appProperties;

    @RequestMapping(value = "/")
    public ModelAndView mainPage() {

        return new ModelAndView("home");
    }

    @RequestMapping(value = "/index")
    public ModelAndView indexPage() {

        return new ModelAndView("home");
    }

    @RequestMapping(value = "/balance", method = RequestMethod.GET)
    public ModelAndView balance() {

        return new ModelAndView("home", "balance", "Min : " + appProperties.getRateMin() + "  Max : " + appProperties.getRateMax());
    }

    @RequestMapping(value = "/expose_event", method = RequestMethod.GET)
    public ModelAndView exposeEvent() {

        manager.start();
        return new ModelAndView("home");
    }

    @RequestMapping(value = "/place_bet", method = RequestMethod.GET)
    public ModelAndView placeBet() {

        return new ModelAndView("home");
    }
}
